home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15704 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.6 KB  |  38 lines

  1. Newsgroups: comp.lang.c++
  2. Path: netcom.com!milod
  3. From: milod@netcom.com (John DiCamillo)
  4. Subject: Re: Is this a memory leak?
  5. Message-ID: <milodDpEs3s.HBJ@netcom.com>
  6. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  7. References: <4jv214$gv7@insosf1.netins.net> <4k02v5$tu7@grimsel.zurich.ibm.com> <4k2vku$s82@werple.net.au> <4k39f5$lhn@grimsel.zurich.ibm.com>
  8. Date: Fri, 5 Apr 1996 21:38:16 GMT
  9. Sender: milod@netcom16.netcom.com
  10.  
  11. wgk@zurich.ibm.com (Keith Whittingham) writes:
  12. >In <4k2vku$s82@werple.net.au>, davidw@werple.net.au (David White) writes:
  13. >>wgk@zurich.ibm.com (Keith Whittingham) writes:
  14.  
  15. >ME>>The dto, ~TopClass, is a going to try and free some memory at the address
  16. >ME>>0x000 but, by a quirk of implmentation, will probably not blow up (as a 
  17. >ME>>simple call to free(0) would). Instead the compiler probably generates
  18. >ME>>code to check that the object address is 0, it so there is no deallocation
  19. >ME>>of the memory.
  20.  
  21. >>The use of 0 as a pointer is not the address 0x000. It is a null pointer
  22. >>as defined by the language. Implementations are not even required to use a
  23. >>bit pattern of all zeroes as a null pointer. They can use any value they
  24. >>like, as long as it will not also be used as a real address. Furthermore,
  25. >>rather than being a quirk of implementation, the language guarantees that
  26. >>deleting a null pointer will do nothing. 
  27.  
  28. >Er, I don't think I agree. 
  29.  
  30. Fine. Be wrong. Hint: Try reading the standard.
  31.  
  32. -- 
  33.     ciao,
  34.     milo
  35. ================================================================
  36.     John DiCamillo                         Fiery the Angels Fell 
  37.     milod@netcom.com       Deep thunder rode around their shores
  38.